package GUI;

import java.awt.BorderLayout;
import java.awt.EventQueue;

import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.border.EmptyBorder;
import javax.swing.GroupLayout;
import javax.swing.GroupLayout.Alignment;
import javax.swing.JLabel;
import javax.swing.LayoutStyle.ComponentPlacement;
import javax.swing.JButton;
import java.awt.Font;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.lang.reflect.Array;
import java.util.ArrayList;

public class BuildMonthlyReportUI extends JFrame {

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	private JPanel contentPane;
	private static int[] arr;
	public static ArrayList<String> list= new ArrayList<String>();

	/**
	 * Launch the application.
	 */
	public static void main(String[] args) {
		EventQueue.invokeLater(new Runnable() {
			public void run() {
				try {
					BuildMonthlyReportUI frame = new BuildMonthlyReportUI(list);
					frame.setVisible(true);
				} catch (Exception e) {
					e.printStackTrace();
				}
			}
		});
	}

	/**
	 * Create the frame.
	 */
	public BuildMonthlyReportUI(ArrayList<String> fields) {

		BuildMonthlyReportUI.list=fields;
		
		String[] names=new String[list.size()];
		names=(String[]) fields.toArray(new String[fields.size()]);
		
		
		setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
		setBounds(100, 100, 450, 300);
		contentPane = new JPanel();
		contentPane.setBorder(new EmptyBorder(5, 5, 5, 5));
		setContentPane(contentPane);
		
		JLabel lblActivityTime = new JLabel("Activity Time");
		lblActivityTime.setFont(new Font("SimSun-ExtB", Font.BOLD | Font.ITALIC, 13));
		
		JLabel lblOfComplaints = new JLabel("# of Complaints");
		
		JLabel lblNewLabel = new JLabel("# pictures in archive");
		
		JLabel lblOfPurchases = new JLabel("# of purchases");
		
		JLabel lblOfUse = new JLabel("# of use layers packages ");
		
		JLabel lblOfUse_1 = new JLabel("# of use purchases packages ");
		
		JLabel lblNewLabel_1 = new JLabel(names[0]);
		
		JLabel lblTotalpicturesssss = new JLabel(names[1]);
		
		JLabel lblPurchasessss = new JLabel(names[2]);
		
		JLabel lblLayerpackegessss = new JLabel(names[3]);
		
		JLabel lblPurchasespackagesss = new JLabel(names[4]);
		
		JButton btnBuildReports = new JButton("Build Reports");
		
		
		
		JButton btnCancel = new JButton("Cancel");
		btnCancel.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent e) {
				dispose();
			}
		});
		
		
		JButton btnBack = new JButton("Back");
		btnBack.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent e) {
				WorkerGUI frame = new WorkerGUI();
				frame.setVisible(true);
				dispose();
			}
		});
		
		
		GroupLayout gl_contentPane = new GroupLayout(contentPane);
		gl_contentPane.setHorizontalGroup(
			gl_contentPane.createParallelGroup(Alignment.LEADING)
				.addGroup(gl_contentPane.createSequentialGroup()
					.addGroup(gl_contentPane.createParallelGroup(Alignment.LEADING)
						.addGroup(gl_contentPane.createSequentialGroup()
							.addGap(52)
							.addGroup(gl_contentPane.createParallelGroup(Alignment.LEADING)
								.addComponent(lblOfComplaints, GroupLayout.PREFERRED_SIZE, 87, GroupLayout.PREFERRED_SIZE)
								.addComponent(lblOfPurchases)
								.addComponent(lblNewLabel)
								.addComponent(lblOfUse)
								.addComponent(lblOfUse_1)))
						.addGroup(gl_contentPane.createSequentialGroup()
							.addGap(38)
							.addGroup(gl_contentPane.createParallelGroup(Alignment.TRAILING)
								.addComponent(lblActivityTime)
								.addGroup(gl_contentPane.createSequentialGroup()
									.addComponent(btnBuildReports)
									.addGap(32)
									.addComponent(btnBack)
									.addGap(35)))))
					.addGroup(gl_contentPane.createParallelGroup(Alignment.LEADING)
						.addComponent(lblNewLabel_1)
						.addComponent(lblTotalpicturesssss)
						.addComponent(lblLayerpackegessss)
						.addComponent(lblPurchasessss)
						.addComponent(lblPurchasespackagesss)
						.addComponent(btnCancel, GroupLayout.PREFERRED_SIZE, 82, GroupLayout.PREFERRED_SIZE))
					.addContainerGap(87, Short.MAX_VALUE))
		);
		gl_contentPane.setVerticalGroup(
			gl_contentPane.createParallelGroup(Alignment.LEADING)
				.addGroup(gl_contentPane.createSequentialGroup()
					.addComponent(lblActivityTime)
					.addGap(27)
					.addGroup(gl_contentPane.createParallelGroup(Alignment.BASELINE)
						.addComponent(lblOfComplaints)
						.addComponent(lblNewLabel_1))
					.addGap(18)
					.addGroup(gl_contentPane.createParallelGroup(Alignment.BASELINE)
						.addComponent(lblNewLabel)
						.addComponent(lblTotalpicturesssss))
					.addGap(18)
					.addGroup(gl_contentPane.createParallelGroup(Alignment.BASELINE)
						.addComponent(lblOfPurchases)
						.addComponent(lblPurchasessss))
					.addGap(18)
					.addGroup(gl_contentPane.createParallelGroup(Alignment.BASELINE)
						.addComponent(lblOfUse)
						.addComponent(lblLayerpackegessss))
					.addGap(18)
					.addGroup(gl_contentPane.createParallelGroup(Alignment.BASELINE)
						.addComponent(lblOfUse_1)
						.addComponent(lblPurchasespackagesss))
					.addPreferredGap(ComponentPlacement.RELATED, 28, Short.MAX_VALUE)
					.addGroup(gl_contentPane.createParallelGroup(Alignment.BASELINE)
						.addComponent(btnCancel)
						.addComponent(btnBuildReports)
						.addComponent(btnBack))
					.addGap(20))
		);
		contentPane.setLayout(gl_contentPane);
	}
}
